/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cart.hibernate.movieInformation;

/**
 *
 * @author BibooChung
 */
import java.util.Date;
import java.util.Set;
import java.util.HashSet;
import cart.hibernate.releaseCompany.*;
import cart.hibernate.rating.*;
import cart.hibernate.genre.*;
import cart.hibernate.actor.*;
import cart.hibernate.coverImage.*;
import cart.hibernate.order.*;




public class MovieInformation {
    private long movieId;
    private String movieName;
    private double unitPrice;
    private double discount;
    private int stockQuantity;
    private Date releaseDate;
    private Date productAvailableDate;
    private String productDescription;

    private ReleaseCompany releaseCompany;
    private Rating rating;

    private Set<Genre> genres = new HashSet<Genre>();
    private Set<Actor> actors = new HashSet<Actor>();
    private Set<CoverImage> images = new HashSet<CoverImage>();
    private Set<Order> orders = new HashSet<Order>();


    public MovieInformation(){
    }

    /*public MovieInformation(String movieName, double unitPrice, double discount, 
                            int stockQuantity, Date releaseDate, Date productAvailableDate, 
                            String productDescription, ReleaseCompany releaseCompany, 
                            Rating rating){
        this.movieName = movieName;
        this.unitPrice = unitPrice;
        this.discount = discount;
        this.stockQuantity = stockQuantity;
        this.releaseDate = new Date(releaseDate.getTime());
        this.productAvailableDate = new Date(productAvailableDate.getTime());
        this.productDescription = productDescription;
        this.releaseCompany = new ReleaseCompany(releaseCompany);
        this.rating = new Rating(rating);
    }*/

    public MovieInformation(String movieName, double unitPrice, double discount, 
                            int stockQuantity, Date releaseDate, Date productAvailableDate, 
                            String productDescription){
        this.movieName = movieName;
        this.unitPrice = unitPrice;
        this.discount = discount;
        this.stockQuantity = stockQuantity;
    //    this.releaseDate = new Date(releaseDate.getTime());
    //    this.productAvailableDate = new Date(productAvailableDate.getTime());
        this.productDescription = productDescription;
        this.releaseDate = releaseDate;
        this.productAvailableDate = productAvailableDate;
    }


    public MovieInformation(MovieInformation movie){
        this.movieName = movie.movieName;
        this.unitPrice = movie.unitPrice;
        this.discount = movie.discount;
        this.stockQuantity = movie.stockQuantity;
    //    this.releaseDate = new Date(movie.releaseDate.getTime());
    //    this.productAvailableDate = new Date(movie.productAvailableDate.getTime());
        this.productDescription = movie.productDescription;
    //    this.releaseCompany = new ReleaseCompany(movie.releaseCompany);
    //    this.rating = new Rating(movie.rating);
        this.releaseDate = movie.releaseDate;
        this.productAvailableDate = movie.productAvailableDate;
        this.releaseCompany = movie.releaseCompany;
        this.rating = movie.rating;
        this.genres = movie.genres;
    }

    public MovieInformation(String movieName, double unitPrice, double discount, 
                            int stockQuantity, Date releaseDate, Date productAvailableDate, 
                            String productDescription, ReleaseCompany releaseCompany, 
                            Rating rating){
        this.movieName = movieName;
        this.unitPrice = unitPrice;
        this.discount = discount;
        this.stockQuantity = stockQuantity;
        this.productDescription = productDescription;
        this.genres = genres;
        this.releaseDate = releaseDate;
        this.productAvailableDate = productAvailableDate;
        this.releaseCompany = releaseCompany;
        this.rating = rating;
    }

    public long getMovieId(){
        return movieId;
    }
    /**
     * Getter of movieName
     * @return this.movieName
     */
    public String getMovieName(){
        return movieName;
    }

    public double getUnitPrice(){
    	return unitPrice;
    }

    public double getDiscount(){
    	return discount;
    }

    public int getStockQuantity(){
    	return stockQuantity;
    }

    public Date getReleaseDate(){
        //Date newDate = new Date(this.releaseDate.getTime());
    	//return newDate;
        return releaseDate;
    }

    public Date getProductAvailableDate(){
       // Date newDate = new Date(this.productAvailableDate.getTime());
       // return newDate;
        return productAvailableDate;
    }

    public String getProductDescription(){
    	return productDescription;
    }

    public ReleaseCompany getReleaseCompany(){
   //     ReleaseCompany newReleaseCompany = new ReleaseCompany(this.releaseCompany);
    //	return newReleaseCompany;
        return releaseCompany;
    }

    public Rating getRating(){
       // Rating newRating = new Rating(this.rating);
    	//return newRating;
        return rating;
    }

    public Set<Genre> getGenres() {  
        return genres;
    } 

    public Set<Actor> getActors() {  
        return actors;  
    }

    public Set<CoverImage> getImages() {  
        return images;  
    } 

    public Set<Order> getOrders() {  
        return orders;
    }
    
    /**
     * Setter of movieId
     * @param movieId set movieId to movieId's value
     */
    public void setMovieId(long movieId) {
        this.movieId = movieId;
    }
    /**
     * Setter of movieName
     * @param movieName set movieName to movieName's value
     */
    public void setMovieName(String movieName){
        this.movieName = movieName;
    }

    public void setUnitPrice(double unitPrice){
        this.unitPrice = unitPrice;
    }

    public void setDiscount(double discount){
        this.discount = discount;
    }

    public void setStockQuantity(int stockQuantity){
        this.stockQuantity = stockQuantity;
    }

    public void setReleaseDate(Date releaseDate){
      //  this.releaseDate = new Date(releaseDate.getTime());
        this.releaseDate = releaseDate;
    }

    public void setProductAvailableDate(Date productAvailableDate){
       // this.productAvailableDate = new Date(productAvailableDate.getTime());
        this.productAvailableDate = productAvailableDate;
    }

    public void setProductDescription(String productDescription){
        this.productDescription = productDescription;
    }

    public void setReleaseCompany(ReleaseCompany releaseCompany){
       // this.releaseCompany = new ReleaseCompany(releaseCompany);
        this.releaseCompany = releaseCompany;
    }

    public void setRating(Rating rating){
      //  this.rating = new Rating(rating);
        this.rating = rating;
    }

    public void setGenres(Set<Genre> genres) {  
        this.genres = new HashSet<Genre>(genres);
    }  

    public void setActors(Set<Actor> actors) {  
        this.actors = new HashSet<Actor>(actors);
    } 

    public void setImages(Set<CoverImage> images) {  
        this.images = new HashSet<CoverImage>(images);
    }  

    public void setOrders(Set<Order> orders) {  
        this.orders = new HashSet<Order>(orders);
    }

    public void setMovieInformation(String movieName, double unitPrice, double discount, 
                                    int stockQuantity, Date releaseDate, Date productAvailableDate, 
                                    String productDescription, ReleaseCompany releaseCompany, 
                                    Rating rating){
        this.movieName = movieName;
        this.unitPrice = unitPrice;
        this.discount = discount;
        this.stockQuantity = stockQuantity;
    //	this.releaseDate = new Date(releaseDate.getTime());
    //	this.productAvailableDate = new Date(productAvailableDate.getTime());
        this.productDescription = productDescription;
    //    this.releaseCompany = new ReleaseCompany(releaseCompany);
    //    this.rating = new Rating(rating);
        this.releaseDate = releaseDate;
        this.productAvailableDate = productAvailableDate;
        this.releaseCompany = releaseCompany;
        this.rating = rating;
    } 

    public void setMovieInformation(String movieName, double unitPrice, double discount, 
                                    int stockQuantity, Date releaseDate, Date productAvailableDate, 
                                    String productDescription, ReleaseCompany releaseCompany, 
                                    Rating rating, Set<Genre> genres){
        this.movieName = movieName;
        this.unitPrice = unitPrice;
        this.discount = discount;
        this.stockQuantity = stockQuantity;
    //    this.releaseDate = new Date(releaseDate.getTime());
    //    this.productAvailableDate = new Date(productAvailableDate.getTime());
        this.productDescription = productDescription;
    //    this.releaseCompany = new ReleaseCompany(releaseCompany);
    //    this.rating = new Rating(rating);
        this.genres = genres;
        this.releaseDate = releaseDate;
        this.productAvailableDate = productAvailableDate;
        this.releaseCompany = releaseCompany;
        this.rating = rating;
    } 
    

    public void addItem(Genre item){
        this.genres.add(item);
    }
    public void addItem(Actor item){
        this.actors.add(item);
    }
    public void addItem(CoverImage item){
        this.images.add(item);
    }
    public void addItem(Order item){
        this.orders.add(item);
    }
}



























